Micron Document
🎖️GitЯра🎖️


Displaying Raw • Download

androidApp/src/google/kotlin/org/meshtastic/app/di/GoogleAiModule.kt b8ab53e712871d076effd2defc55be720495aba5 (b8ab53e7) Text, 2.64 KB

T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.app.di

Tff7b72import T7ee787android.content.Context
Tff7b72import T7ee787okio.FileSystem
Tff7b72import T7ee787okio.Path.Companion.toOkioPath
Tff7b72import T7ee787org.koin.core.annotation.Module
Tff7b72import T7ee787org.koin.core.annotation.Single
Tff7b72import T7ee787org.meshtastic.app.ai.GeminiNanoDocAssistant
Tff7b72import T7ee787org.meshtastic.app.discovery.GeminiNanoSummaryProvider
Tff7b72import T7ee787org.meshtastic.app.translation.MlKitDocTranslator
Tff7b72import T7ee787org.meshtastic.core.repository.NodeRepository
Tff7b72import T7ee787org.meshtastic.feature.discovery.DiscoverySummaryGenerator
Tff7b72import T7ee787org.meshtastic.feature.discovery.ai.DiscoverySummaryAiProvider
Tff7b72import T7ee787org.meshtastic.feature.docs.ai.AIDocAssistant
Tff7b72import T7ee787org.meshtastic.feature.docs.data.DocBundleLoader
Tff7b72import T7ee787org.meshtastic.feature.docs.data.KeywordSearchEngine
Tff7b72import T7ee787org.meshtastic.feature.docs.translation.DocTranslationCache
Tff7b72import T7ee787org.meshtastic.feature.docs.translation.DocTranslationService

T8b949e// TODO: Enable Firebase App Check (with Play Integrity provider) if hybrid/cloud
T8b949e// fallback is ever adopted. App Check only gates cloud proxy requests — on-device
T8b949e// inference (ONLY_ON_DEVICE mode) bypasses it entirely, so no action needed today.

T8b949e/** Provides the on-device Gemini Nano AI assistant for the Google flavor. */
Tf0883e@Module
Tff7b72class T56d364GoogleAiModule Tb4b4b4{
Tf0883e@Single
Tff7b72fun Td2a8ffaiDocAssistantTb4b4b4(
Te6edf3searchEngineTb4b4b4: Te6edf3KeywordSearchEngineTb4b4b4,
Te6edf3bundleLoaderTb4b4b4: Te6edf3DocBundleLoaderTb4b4b4,
Te6edf3nodeRepositoryTb4b4b4: Te6edf3NodeRepositoryTb4b4b4,
Tb4b4b4)Tb4b4b4: Te6edf3AIDocAssistant Tff7b72= Te6edf3GeminiNanoDocAssistantTb4b4b4(Te6edf3searchEngineTb4b4b4, Te6edf3bundleLoaderTb4b4b4, Te6edf3nodeRepositoryTb4b4b4)

Tf0883e@Single
Tff7b72fun Td2a8ffdiscoverySummaryAiProviderTb4b4b4(Te6edf3generatorTb4b4b4: Te6edf3DiscoverySummaryGeneratorTb4b4b4)Tb4b4b4: Te6edf3DiscoverySummaryAiProvider Tff7b72=
Te6edf3GeminiNanoSummaryProviderTb4b4b4(Te6edf3generatorTb4b4b4)

Tf0883e@Single
Tff7b72fun Td2a8ffdocTranslationCacheTb4b4b4(Te6edf3contextTb4b4b4: Te6edf3ContextTb4b4b4)Tb4b4b4: Te6edf3DocTranslationCache Tff7b72=
Te6edf3DocTranslationCacheTb4b4b4(Te6edf3cacheDir Tff7b72= Te6edf3contextTb4b4b4.Te6edf3cacheDirTb4b4b4.Te6edf3toOkioPathTb4b4b4(Tb4b4b4)Tb4b4b4, Te6edf3fileSystem Tff7b72= Te6edf3FileSystemTb4b4b4.Te6edf3SYSTEMTb4b4b4)

Tf0883e@Single Tff7b72fun Td2a8ffdocTranslationServiceTb4b4b4(Te6edf3cacheTb4b4b4: Te6edf3DocTranslationCacheTb4b4b4)Tb4b4b4: Te6edf3DocTranslationService Tff7b72= Te6edf3MlKitDocTranslatorTb4b4b4(Te6edf3cacheTb4b4b4)
Tb4b4b4}

Served by rngit 1.5.0 - Generated in 0.04s